﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Linq.Expressions;

namespace MK_Movie_Manager
{
    public partial class SearchPopupControl : UserControl
    {
        public string searchString
        {
            get
            {
                return this.txtSearch.Text;
            }
        }
        public SearchPopupControl(Control curParent, System.EventHandler parentAction)
        {
            InitializeComponent();
            InitializePosition(curParent);
            this.btnSearch.Click += parentAction;
        }

        private void InitializePosition(Control curParent)
        {
            int x = curParent.Location.X;
            int y = curParent.Location.Y;
            int w = curParent.Width;
            int h = curParent.Height;
            int l = this.Width;
            this.Location = new Point((x + (w / 2) - (l / 2)), (y + h));
        }

        private void pbHide_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }



    }
}
